{% load static %}
<h1 class="title">狮子庙中学内部办公平台</h1>
<nav class="navbar navbar-expand-lg  navbar-light" style="background-color: #87a0f2;">
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03"
            aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <a class="navbar-brand" href="{% url 'index' %}">站内导航</a>

    <div class="collapse navbar-collapse" id="navbarTogglerDemo03">
        <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
            <li class="nav-item active">
                <a class="nav-link" href="{% url 'index' %}">
                    <div style="display: inline-block;width:30px;height:30px;"><img style="width: auto;height: 80%;"
                    src="{% static "icon/home.svg" %}">
                    </div>

                    首页 <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link text-warning" href="{% url 'index' %}">关于</a>
            </li>
            {% if user.username %}
                <li class="nav-item ">
                    {#                <a class="nav-link text-warning" href="{% url 'JDComment_New' %}">VIP京东工具_新评论</a>#}
                </li>
                <li class="nav-item">
                    <a class="nav-link text-warning" href="{% url 'editor' %}">发布文章</a>
                </li>
            {% endif %}
            {#            <li class="nav-item">#}
            {#                <a class="nav-link disabled" href="{% url 'index' %}"></a>#}
            {#            </li>#}
        </ul>
{#        <form class="form-inline my-2 my-lg-0">#}
{#            <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">#}
{#            <button class="btn btn-outline-dark my-2 my-sm-0" type="submit">Search</button>#}
{#        </form>#}
        {% if user.username %}
            <div style="display: inline-block;width:40px;height:40px; overflow: hidden; border:2px solid;
border-radius:25px; border-color: white; margin-right: 5px;"><img style="width: auto;height: 100%"
                                               src="{{ MEDIA_URL }}{{ account.userIMG }}"></div>
            <span class="title">{{ account.nickName }}</span>
            <a class="btn btn-default" href="{% url 'exit' %}" role="button">

                点击退出</a>
            <!-- 否则显示登录注册的链接 -->
        {% else %}
            <a class="btn btn-default" href="{% url 'Login' %}" role="button">登录</a>

        {% endif %}
    </div>
</nav>
